<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>首页</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">


<!-- 新 Bootstrap 核心 CSS 文件 -->
<!--<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css">-->
 <!-- Loading Bootstrap -->
<link href="__PUBLIC__/FlatUI/css/vendor/bootstrap.min.css" rel="stylesheet">

<!-- Loading Flat UI -->
<link href="__PUBLIC__/FlatUI/css/flat-ui.css" rel="stylesheet">


<link rel="shortcut icon" href="__PUBLIC__/images/logo/1155606.png">

<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
<!--[if lt IE 9]>
  <script src="__PUBLIC__/FlatUI/js/vendor/html5shiv.js"></script>
  <script src="__PUBLIC__/FlatUI/js/vendor/respond.min.js"></script>
<![endif]-->

  <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="__PUBLIC__/FlatUI/js/vendor/jquery.min.js"></script>
<!--<script src="__PUBLIC__/js/common/jquery.color.js"></script>-->

<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="__PUBLIC__/FlatUI/js/flat-ui.min.js"></script>

<script src="__PUBLIC__/js/home/login_register.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<!--<script src="http://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>-->
<link rel="stylesheet" href="__PUBLIC__/css/home.css">
 <style type="text/css">
  body {
    padding-top: 70px;

  }

</style>
</head>

<!-- Static navbar -->
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
        <span class="sr-only">Toggle navigation</span>
      </button>
      <a class="navbar-brand" href="{:U('Home/Index/index')}">
          <img src="__PUBLIC__/images/logo/1155606.png" style="margin:0; padding:0;margin-top:-5px;" height="32px" width="32px">
          <font style="font-weight: bold; font-family: monospace;">Beginner</font>
        </a>
    </div>
    <div class="navbar-collapse collapse">
      <ul class="nav navbar-nav">
          <li class="active"><a href="{:U('Home/Index/index')}"><span class="glyphicon glyphicon-home"></span> 主页</a></li>
        <li><a href="#"><span class="glyphicon glyphicon-comment"></span> 讨论</a></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-pencil"></span> 笔记 <b class="caret"></b></a>
          <ul class="dropdown-menu">
              <volist name="typeList" id="vo">
                  <li>
                      <a href="{:U('Home/Index/index', array('cont_type' => $vo['type_no']))}" class="">{$vo.type_name}</a>
                  </li>
              </volist>
          </ul>
        </li>

      </ul>
        <ul class="nav navbar-nav navbar-right">
        <!-- 获取session里的值 {$_SESSION['USERNAME4SESSION']} -->
            <if condition="$_SESSION['USERNAME4SESSION'] eq null">
                <li>
                    <!-- 点击时触发id为 contact 的元素,放在最底部了  -->
                    <a href="#loginmodal" data-toggle="modal" style="float:right;">登录</a>
                </li>
                <li>
                    <a href="{:U('Home/Index/register')}" data-toggle="modal" style="float:right; margin-left:-30px;">注册</a>
                </li>
            <else />
               <li>
                <a>欢迎您，{$_SESSION['USERNAME4SESSION']}&nbsp;&nbsp;</a>
                </li>
                <li>
                    <a href="{:U('Home/Index/logout')}" data-toggle="modal"
                       style="float:right; margin-left:-30px;">退出</a>
                </li>
            </if>

        </ul>
    </div><!--/.nav-collapse -->
  </div>

</div>


<!-- 登录表单 -->
<form method="post" name="loginForm" id="loginForm" action="{:U('Home/Index/login')}" >
<!-- 点击 登录 弹出窗口-->
<div class="modal fade" id="loginmodal" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                请输入您的用户名和密码！
                <font color='red' id="loginErrorTip" style="display:none;">您输入的用户名和密码有误，请确认后重新输入！</font>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 has-feedback">
                        <!-- 当页面的js校验通过时给div添加2个类：通过时候 has-success  fui-check 不通过时候： has-error 改变输入框的颜色 -->
                        <div class="form-group" id="userTip">
                        <input type="text" class="form-control input-sm" name="username" id="username"
                               placeholder="请输入您的用户名" onfocus="hideTipInfo1()" />
                        <span class="form-control-feedback"></span>
                        <span id="showInfo22" class="" title="用户名不能为空！" data-placement="bottom"></span>
                        </div>

                    </div>

                    <!-- <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2"></div>-->
                    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
                        <div class="form-group" id="pswTip">
                        <input type="password" name="password" id="password"
                               class="form-control input-sm" placeholder="请输入您的密码"
                                onfocus="hideTipInfo2()" />
                            <span class="form-control-feedback"></span>
                        <span id="showInfo" title="密码不能为空！" data-placement="bottom"></span>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        在这里添加第三方登录
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <input type="button" value="登录" class="btn btn-info" style="padding:4px 8px;" onclick="checkHasNullValue();">
                &nbsp;&nbsp;
                <!-- 点击关闭，关闭的是 modal，即class为modal的标签 -->
                <a class="btn btn-default" data-dismiss="modal" style="padding:4px 8px;">
                    取消
                </a>
            </div>
        </div>
    </div>
</div>
</form>

